#pragma once

#include "..\Manager\sdsky.h"

namespace sdsky2
{
	class SdskyRenderer
	{
	public:
		SdskyRenderer(std::shared_ptr<DX::DeviceResources> const resources);

		~SdskyRenderer();

		void Update();

		void Render();

		void RenderTrack();

		void RenderStar();

		void CreateDeviceResources();

		void CreateDeviceSizeResources();

		void ReleaseDeviceResources();

		void ReleaseDeviceSizeResources();

		void ClearTrack();

	private:

		void CreateDeviceIndependentResources();

		void ReleaseDeviceIndependentResources();

		Microsoft::WRL::ComPtr<ID2D1EllipseGeometry> m_ellipse;

		Microsoft::WRL::ComPtr<ID2D1RadialGradientBrush> m_radialBrush;

		Microsoft::WRL::ComPtr<ID2D1SolidColorBrush> m_whiteBrush;

		Microsoft::WRL::ComPtr<ID2D1Bitmap1> m_trackBitmap;

		std::shared_ptr<DX::DeviceResources> m_deviceResources;

		bool m_line = false;

		float m_scale = 1.0f;

		sdsky m_sdsky;
	};
}